package com.wanho.java157.SystemSetting.mapper;

import com.wanho.java157.SystemSetting.po.Employee;
import com.wanho.java157.SystemSetting.po.Menu;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import java.util.List;

import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@ContextConfiguration({"classpath:spring/applicationContext.xml","classpath:spring/applicationContext-springmvc.xml"})
@WebAppConfiguration
public class MenuMapperTest {

    @Autowired
    private MenuMapper menuMapper;

    @Test
    public void selectMenuByEmployeeid() {
        Employee employee=new Employee();
        employee.setEmployeeId(5);
        List<Menu> menuList= menuMapper.selectMenuByEmployeeid(employee);
        for (Menu menu : menuList) {
            System.out.println(menu);
        }
    }
}